package com.gz.entity;

import java.util.List;

public class User {
    private Integer id;
    private String name;
    //一个主人对应多只猫
    private List<Pet> pets;


    //这个toString会有一些麻烦,User的toString和 Pet的toString相互调用，造成无限递归
//    @Override
//    public String toString() {
//        return "User{" +
//                "id=" + id +
//                ", name='" + name + '\'' +
//                ", pets=" + pets +
//                '}';
//    }

    public List<Pet> getPets() {
        return pets;
    }

    public void setPets(List<Pet> pets) {
        this.pets = pets;
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
